<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>问卷模板列表</title>
		<%@ include file="/include/resources.jsp" %>
	</head>
	<body>
		<script type="text/javascript" src="msi/questionnaire/questionnaire.js"></script>
		<input type="hidden" id="_projectId" value="<s:property value='template.projectId'/>">
		<div style="padding:5px;background:#fafafa;border-bottom:1px solid #eee;">
			<table cellpadding="0" cellspacing="0" style="width:100%">
				<tr>
					<td style="text-align:left">
						<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-add" onclick="openTemplatePage();">创建模板</a>
						<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-remove" onclick="delTemplate();">删除模板</a>
						<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-open" onclick="enableTemplate()">启用</a>
					</td>
					<td style="text-align:right">
						<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-cancel" onclick="javascript:$('#questionnaireDialog').dialog('close')">关闭</a>
					</td>
				</tr>
			</table>
		</div>
		<div style="padding:10px;height: 340px">
			<table id="templatelList" idField="templateId" fit="true" singleSelect="true" pagination="true" rownumbers="true">
				<thead>
					<tr>
						<th field="templateId" hidden="true">模板ID</th>
						<th field="templateCode" width="130">模板编号</th>
						<th field="templateName" width="80">模板名称</th>
						<th field="templateVersion" width="80">模板版本</th>
						<th field="templateState" width="80">模板状态</th>
						<th field="createTime" width="80">创建时间</th>
					</tr>
				</thead>
			</table>
		</div>
		<script type="text/javascript">
			$(function(){
				var _projectId = $("#_projectId").val();
				$('#templatelList').datagrid({
					width : 660,
					pagination:true,
					url:"searchTemplate.do?template.projectId="+_projectId,
					onDblClickRow:function(rowIndex, rowData) {
						openTemplatePage(rowData.templateId);
					}
				});
			});
		</script>
		
	</body>
</html>